[TOC]

Matrix Transpose

This page introduces transposes of real and complex matrices.

Real Matrices

The transpose of an matrix of real numbers

is given by

That means, when taking the transpose of ,

for all and all ,

To find transposes, SIMO offers the following operators and functions:

The complex conjugate of a real number is itself. Therefore, for the real matrix A, the following matrices are the same:

💡 These operators and functions do not work for A with more than 2 dimensions, i.e., ndim(A) > 2.

Example

The transpose and conjugate transpose of a randomly generated real matrix are the same.

Input
% Random matrix.
r = rand(3,4)
% Transpose.
r.'
% Complex conjugate transpose
r'
Output
 = 1e-1 × 
 0.7546   8.7160   3.0373   5.5844
 3.9817   0.0541   4.3378   5.1050
 8.1191   7.9236   3.2574   7.7646

ans = 1e-1 × 
 0.7546   3.9817   8.1191
 8.7160   0.0541   7.9236
 3.0373   4.3378   3.2574
 5.5844   5.1050   7.7646

ans = 1e-1 × 
 0.7546   3.9817   8.1191
 8.7160   0.0541   7.9236
 3.0373   4.3378   3.2574
 5.5844   5.1050   7.7646

Complex Matrices

The conjugate transpose of an matrix of complex numbers

is given by

For the matrix A of complex numbers, its conjugate transpose can be obtained by A' or ctranspose(A). When conjugates are not required, you can use A.' or transpose(A) to find the (non-conjugate) transpose.

💡 These operators and functions do not work for A with more than 2 dimensions, i.e., ndim(A) > 2.

Example

The transpose and complex conjugate transpose of a randomly generated complex matrix.

Input
% Random complex matrix.
r = rand(3,4) + rand(3,4)*i
% Transpose.
r.'
% Complex conjugate transpose
r'
Output
r = 1e-1 × 
 6.4637 + 6.6888i   2.5425 + 8.0223i   7.3450 + 8.2596i   2.6829 + 7.0021i
 4.0511 + 0.3917i   7.4915 + 5.3168i   8.9667 + 0.0910i   4.4199 + 6.4485i
 4.6943 + 5.5860i   0.8644 + 5.4784i   1.0989 + 8.8801i   8.5181 + 2.9303i

ans = 1e-1 × 
 6.4637 + 6.6888i   4.0511 + 0.3917i   4.6943 + 5.5860i
 2.5425 + 8.0223i   7.4915 + 5.3168i   0.8644 + 5.4784i
 7.3450 + 8.2596i   8.9667 + 0.0910i   1.0989 + 8.8801i
 2.6829 + 7.0021i   4.4199 + 6.4485i   8.5181 + 2.9303i

ans = 1e-1 × 
 6.4637 - 6.6888i   4.0511 - 0.3917i   4.6943 - 5.5860i
 2.5425 - 8.0223i   7.4915 - 5.3168i   0.8644 - 5.4784i
 7.3450 - 8.2596i   8.9667 - 0.0910i   1.0989 - 8.8801i
 2.6829 - 7.0021i   4.4199 - 6.4485i   8.5181 - 2.9303i